﻿using System.ComponentModel.Composition;
using Caliburn.Micro;
using YiJing.Model;

namespace YiJing.ViewModels
{
    [Export(typeof(TrigramViewModel)), PartCreationPolicy(CreationPolicy.NonShared)]
    public class TrigramViewModel : PropertyChangedBase
    {
        private TrigramFigure _figure;

        private bool _isSelected;

        public string Header
        {
            get; set;
        }

        public int Position 
        { 
            get;
            set;
        }

        public bool IsComplete
        {
            get { return Figure != null; }
        }

        public bool IsSelected
        {
            get { return _isSelected; }
            set
            {
                _isSelected = value;
                NotifyOfPropertyChange(() => IsSelected);
            }
        }

        public TrigramFigure Figure
        {
            get { return _figure; }
            set
            {
                _figure = value;
                NotifyOfPropertyChange(() => Figure);
            }
        }
    }
}